package com.example.wuqiu.module.sys.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.example.wuqiu.module.sys.entity.SysUserOrgan;
import com.example.wuqiu.module.sys.dao.SysUserOrganMapper;
import com.example.wuqiu.module.sys.service.SysUserOrganService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author RedStar
 * @since 2023-02-05
 */
@Service
public class SysUserOrganServiceImpl extends ServiceImpl<SysUserOrganMapper, SysUserOrgan> implements SysUserOrganService {

    @Override
    public List<SysUserOrgan> listByOrganIds(List<String> organIdList) {
        LambdaQueryWrapper<SysUserOrgan> queryWrapper = new LambdaQueryWrapper<>();
        List<SysUserOrgan> list = new ArrayList<>();
        if ( organIdList != null && organIdList.size() > 0){
            queryWrapper.in(SysUserOrgan::getOrganId, organIdList);
            list = list(queryWrapper);
        }
        return list;
    }
}
